package com.example.service.ServiceImpl;

import com.example.entity.Event;
import com.example.mapper.EventMapper;
import com.example.service.EventService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EventServiceImpl implements EventService {

    @Resource
    EventMapper mapper;


    @Override
    public List<Event> selectEvent(String eventsName) {
        return mapper.selectEvent(eventsName);
    }

    @Override
    public void addEvent(Event event) {
        mapper.addEvent(event);
    }

    @Override
    public void deleteEvent(int eventId) {
        mapper.deleteEvent(eventId);
    }

    @Override
    public String add(Event event){
        mapper.add(event);
        return "success";
    }

    @Override
    public List<Event> selectEventNear() {
        return mapper.selectEventNear();
    }
}
